package com.example.common.controller;

import com.example.common.service.TestService;
import com.example.common.utils.Statistics;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Lazy
@RestController
@RequestMapping("/tests")
public class TestController {

    private final TestService testService;

    @Autowired
    public TestController(TestService testService) {
        this.testService = testService;
    }

    @GetMapping("/do-test")
    public Object doTest(@RequestParam(required = false) Object args){
        Statistics.logInfo(log, "doTest", args);
        return testService.doTest(args);
    }
}
